package com.im.project.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 会话消息
 *
 * @author yunZhouJiaDi
 */
@Data
@TableName("chat_message")
@Accessors(chain = true)
public class ChatMessage {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("会话id")
    private String chatId;

    @ApiModelProperty("消息id")
    private String messageId;

    @ApiModelProperty("消息类型(text:文本,image:图片,video:视频,file:文件,voice:语音,common:通用,withdraw:撤回,reply:回复")
    private String messageType;

    @ApiModelProperty("消息内容")
    private String messageContent;

    @ApiModelProperty("联系人类型(0:单聊 1:群聊)")
    private Integer contactType;

    @ApiModelProperty("发送人id")
    private String sendUserId;

    @ApiModelProperty("发送人名称")
    @TableField(exist = false)
    private String sendUsername;

    @ApiModelProperty("发送人头像")
    @TableField(exist = false)
    private String sendUserIcon;

    @ApiModelProperty("发送时间")
    private Long sendTime;

    @ApiModelProperty("接收联系人id")
    private String contactId;

    @ApiModelProperty("联系人名称")
    @TableField(exist = false)
    private String contactUsername;

    @ApiModelProperty("联系人头像")
    @TableField(exist = false)
    private String contactUserIcon;

    @ApiModelProperty("群人数")
    @TableField(exist = false)
    private Integer memberCount;

    @ApiModelProperty("文件大小")
    private Long fileSize;

    @ApiModelProperty("文件名")
    private String fileName;

    @ApiModelProperty("撤回消息id")
    private String withdrawId;

    @ApiModelProperty("是否撤回（1-未撤回，2-已撤回）")
    private Integer msgWithdrawn;

    @ApiModelProperty("是否置顶（1-否，2-是）")
    private Integer msgTop;

    @ApiModelProperty("回复消息id")
    private String replyId;

    @ApiModelProperty("回复消息类型")
    private String replyMessageType;

    @ApiModelProperty("回复人名称")
    private String replyName;

    @ApiModelProperty("回复内容")
    private String replyContent;

    @ApiModelProperty("文件大小(正对文件类型的回复)")
    private Long replyFileSize;

}
